package com.chen10.cattle.mapper;

import com.chen10.cattle.model.pojo.FriendRequests;
import com.chen10.cattle.model.vo.FriendRequestListVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface FriendRequestMapper {

    /**
     * 根据发送方id和接收方id和状态查询好友请求
     */
    FriendRequests getBySenderIdAndReceiverIdAndStatus(Integer senderId, Integer receiverId, String status);

    /**
     * 插入好友请求
     * @param request
     */
    void insert(FriendRequests request);

    /**
     * 根据id查询好友请求
     * @param requestId
     * @return
     */
    FriendRequests getByRequestId(Integer requestId);

    /**
     * 更新请求好友状态
     * @param requestId
     * @param status
     */
    void updateStatus(Integer requestId, String status);

    /**
     * 获取好友请求列表
     * @param userId
     * @return
     */
    List<FriendRequestListVO> getFriendRequestList(Integer userId);
}
